home *** CD-ROM | disk | FTP | other *** search
Modula Implementation | 1997-02-14 | 1.8 KB | 58 lines | [TEXT/3PRM] |
- implementation module memory;
-
- import mac_types;
-
- NewHandle :: !Int !Toolbox -> (!Handle,!Int,!Toolbox);
- NewHandle logicalSize t = code (logicalSize=D1,t=D0)(handle=D2,result_code=D1,z=Z){
- instruction 0x2001 || move.l d1,d0
- instruction 0xA122 || _NewHandle
- instruction 0x2408 || move.l a0,d2
- instruction 0x2200 || move.l d0,d1
- };
-
- DisposHandle :: !Handle !Toolbox -> (!Int,!Toolbox);
- DisposHandle h t = code (h=D1,t=U)(result_code=D1,z=Z){
- instruction 0x2041 || move.l d1,a0
- instruction 0xA023 || _DisposHandle
- instruction 0x2200 || move.l d0,d1
- };
-
- NewPtr :: !Int !Toolbox -> (!Ptr,!Int,!Toolbox);
- NewPtr logicalSize t = code (logicalSize=D1,t=U)(pointer=D2,result_code=D1,z=Z){
- instruction 0x2001 || move.l d1,d0
- instruction 0xA11E || _NewPtr
- instruction 0x2408 || move.l a0,d2
- instruction 0x2200 || move.l d0,d1
- };
-
- DisposPtr :: !Ptr !Toolbox -> (!Int,!Toolbox);
- DisposPtr p t = code (p=D1,t=U)(result_code=D1,z=Z){
- instruction 0x2041 || move.l d1,a0
- instruction 0xA01F || _DisposPtr
- instruction 0x2200 || move.l d0,d1
- };
-
- GetHandleSize :: !Handle !Toolbox -> (!Int,!Toolbox);
- GetHandleSize handle t = code (handle=D1,t=U)(result_code=D1,z=Z){
- instruction 0x2041 || move.l d1,a0
- instruction 0xA025
- instruction 0x2200 || move.l d0,d1
- }
-
- GetPtrSize :: !Int !Toolbox -> (!Int,!Toolbox);
- GetPtrSize p t = code (p=D1,t=U)(size=D1,z=Z){
- instruction 0x2041 || move.l d1,a0
- instruction 0xA021 || _GetPtrSize
- instruction 0x2200 || move.l d0,d1
- };
-
- copy_handle_data_to_string :: !{#Char} !Handle !Int !Toolbox -> Toolbox;
- copy_handle_data_to_string string handle size t0 = code (string=A0,handle=D2,size=D1,t0=U)(t1=Z){
- instruction 0x2248 || move.l a0,a1
- instruction 0x2042 || move.l d2,a0
- instruction 0x5089 || addq.l #8,a1
- instruction 0x2050 || move.l (a0),a0
- instruction 0x2001 || move.l d1,d0
- instruction 0xA22E || BlockMoveData
- };
-